package io.demo.message.util;

import io.demo.message.domain.Ethnic;
import java.util.function.Supplier;
import org.apache.commons.lang3.RandomUtils;

public class RandomEthnicSupplier implements Supplier<Ethnic> {

  private RandomStringBuilder randomStringBuilder = RandomStringBuilder.newBuilder()
      .useLowerCase()
      .useUpperCase()
      .useDigit();

  @Override
  public Ethnic get() {
    return Ethnic.builder()
        .id(RandomUtils.nextLong())
        .name(randomStringBuilder.build(10, 30))
        .population(RandomUtils.nextLong(100, 1000_000_000))
        .skinColor(TestingModels.skinColor())
        .build();

  }
}
